package com.chis.ms;

import java.io.*;

public class TestX {

    public static void main(String[] args) {

        File file1 = new File("C:\\Users\\wlj\\Desktop\\1649613601147.xml");
        FileReader m = null;
        try {
            m = new FileReader(file1);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        BufferedReader reader = new BufferedReader(m);
        boolean boo = false;
        StringBuilder sb = null;

        while (true) {
            String nextline = null;
            try {
                nextline = reader.readLine();
                if (nextline != null && nextline.length() > 1) {
                    nextline = nextline.trim();
                    if(nextline.startsWith("</data>")){
                        boo = false;
                        System.out.println(sb.toString());
                    }
                    if(boo){
                        sb.append(nextline.substring(nextline.indexOf(">")+1,nextline.indexOf("</"))).append("#");
                    }
//                    System.out.println(nextline);
                    if(nextline.startsWith("<data>")){
                        boo = true;
                        sb = new StringBuilder();
                    }









                }
            } catch (Exception e) {
                e.printStackTrace();
                System.out.println(nextline);
            }
            if (nextline == null) break;
        }
    }
}
